package com.joysuch.wwyt.attendant.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * ProcessStatus类型
 *
 * @author xsx
 * @version 1.0
 * @date 2023/2/16 17:45
 */
public enum ProcessStatusEnum {

    DELETE("delete", "删除状态"),

    TERMINATE("terminate", "终止(作废)"),

    UNFINISHED("unfinished", "未完成"),

    FINISHED("finished", "完成");

    private String value;

    private String desc;

    ProcessStatusEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public final String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    private static final Map<String, ProcessStatusEnum> lookup = new HashMap<>();

    static {
        for (ProcessStatusEnum e : EnumSet.allOf(ProcessStatusEnum.class)) {
            lookup.put(e.value, e);
        }
    }

    public static ProcessStatusEnum find(String value) {
        return lookup.get(value);
    }
}
